package org.springblade.modules.admin.vo.rescue;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.admin.enums.EmerProcTypeEnum;
import org.springblade.modules.admin.enums.WorkOrderTypeEnum;

import java.util.Date;
import java.util.List;

/**
 * @author zcc
 * @version 1.0
 * @date 2023/2/27 15:47
 */
@Data
@ApiModel("工单子任务")
public class PlanChildInfoVo {

	@ApiModelProperty("任务编号")
	private Long planId;

	@ApiModelProperty("任务类型名称")
	private String planTypeStatusName = "维修";

	@ApiModelProperty("执行人")
	private String userNames;

	@ApiModelProperty("组别")
	private String groupName;

	@ApiModelProperty("项目名称")
	private String buildingName;

	@ApiModelProperty("梯号")
	private String elevatorName;

	@ApiModelProperty("报障人=来源")
	private String sourceUserName;

	@ApiModelProperty("来源渠道名称")
	private Integer sourceType;

	@ApiModelProperty("任务描述")
	private String planDesc;

	@ApiModelProperty("创建时间")
	private Date createTime;

	@ApiModelProperty("开始时间")
	private Date beginTime;

	@ApiModelProperty("完成时间")
	private Date finishTime;

	@ApiModelProperty("状态")
	private Integer status;

	/**
	 * 紧急程度
	 */
	private Integer emerProcType;

	/**
	 * 工单类型
	 */
	private Integer workOrderType;

	/**
	 * 紧急程度描述
	 */
	private String emerProcTypeName;

	/**
	 * 工单类型描述
	 */
	private String workOrderTypeName;

	public void setEmerProcType(Integer emerProcType) {
		if(Func.isNotEmpty(emerProcType)){
			this.emerProcTypeName = EmerProcTypeEnum.getName(emerProcType);
		}
		this.emerProcType = emerProcType;
	}

	public void setWorkOrderType(Integer workOrderType) {
		if(Func.isNotEmpty(workOrderType)){
			this.workOrderTypeName = WorkOrderTypeEnum.getName(workOrderType);
		}
		this.workOrderType = workOrderType;
	}
}
